package com.marktotop.service.impl;

import com.marktotop.entity.Department;
import com.marktotop.mapper.DepartmentMapper;
import com.marktotop.service.IDepartmentService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author marktotop
 * @since 2021-05-23
 */
@Service
public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Department> implements IDepartmentService {
    @Autowired
    private DepartmentMapper departmentMapper;
    /**
     * 查询所有部门
     * @return
     */
    @Override
    public List<Department> getAllDepartment() {
        return departmentMapper.getAllDepartment(-1);
    }
    /**
     * 添加部门
     * @return
     */
    @Override
    public void addDept(Department department) {
        departmentMapper.addDept(department);
    }
    /**
     * 删除部门
     * @param department
     */
    @Override
    public void delDept(Department department) {
        departmentMapper.delDept(department);
    }


}
